package com.hui.model;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(
        value = "PageNumberParam (分页参数)",
        description = "分页参数"
)
public class PageNumberParam {
    @ApiModelProperty("页码,默认为1")
    private Integer page = 1;
    @ApiModelProperty("页大小,默认为10")
    private Integer limit = 10;

    public Integer getPage() {
        return page;
    }

    @ApiModelProperty("当前第几页")
    public void setPage(Integer page) {
        if (page != null && page > 0) {
            this.page = page;
        } else {
            this.page = 1;
        }
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        if (limit != null && limit > 0) {
            this.limit = limit;
        } else {
            this.limit = 10;
        }
    }
}
